import Vue from 'vue';
import VueRouter from 'vue-router';
import HomeView from '../views/HomeView.vue';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    meta: {
      title:"首页"
    }
  },
  {
    path: '/study',
    name: 'study',
    component: () => import("../views/StudyView.vue"),
     meta: {
      title:"在学"
    }
  },
  {
    path: '/member',
    name: 'member',
    component: () => import("../views/MyView.vue"),
     meta: {
      title:"我的"
    }
  },
  {
    path: "/member/promocode",
    name: "promocode",
    meta: {
      title: "我的优惠码",
      auth:true,
    },
    component: () => import("../views/PromocodeView.vue"),
    
  },
  {
    path: "/member/order",
    name: "order",
    meta: {
      title: "我的优惠码",
      auth:true,
    },
    component: () => import("../views/OrderView.vue"),
  },
  {
    path: "/member/vip",
    name: "vip",
    meta: {
      title: "VIP会员",
      auth:true,
    },
    component: () => import("../views/VIPView.vue"),
  },
  {
    path: "/member/mymsg",
    name: "mymsg",
    meta: {
      title: "个人中心",
      auth:true,
    },
    component: () => import("../views/MyMsgView.vue"),
  },
  {
    path: "/member/bymsg",
    name: "bymsg",
    meta: {
      title: "收银台",
      auth:true,
    },
    component: () => import("../views/BYMsgView.vue"),
  },
  {
    path: "/member/mynews",
    name: "mynews",
    meta: {
      title: "订单消息",
      auth:true,
    },
    component: () => import("../views/MyNewsView.vue"),
  },
  {
    path: '/login',
    name: 'login',
    component: () => import("../views/LoginView.vue"),
     meta: {
      title:"登录"
    }
  },
  
  {
    path: '/vod',
    name: 'vod',
    component: () => import('../views/VodView.vue'),
     meta: {
      title:"全部视频"
    }
  },
  {
    path: '/vod/detail',
    name: 'detail',
    component: () => import('../views/DetailView.vue'),
     meta: {
      title:"课程详情页"
    }
  },
  {
    path: '/member/setting',
    name: 'setting',
    component: () => import('../views/SettingView.vue'),
     meta: {
      title:"设置"
    }
  },
  {
    path: '/aboutus',
    name: 'aboutus',
    component: () => import('../views/AboutView.vue'),
     meta: {
      title:"关于我们"
    }
  },
  
];

const router = new VueRouter({
  routes,
});

export default router;
